This is a half year ago did not write the article, now take out to share under. There may be some incorrect or inaccurate places, some languages may be more frivolous, please forgive me.
For an example of the above email data
Data table:
CREATE TABLE Email (
emailid mediumint (8) unsigned not NULL auto_increment COMMENT ' mail id ',
fromid Int (a) unsigned Not null default ' 0 ' COMMENT ' Sender ID ',
toid Int (a) unsigned NOT null default ' 0 ' COMMENT ' recipient id ',
Like the following optional matching pattern:Sph_match_all, matching all query terms (default mode);Sph_match_any, matches any one of the query words;Sph_match_phrase, the whole query is regarded as a phrase, which requires a complete match in order;
Search Sub Domain
For example, search jb51.net will www.jb51.net, jb51.net, host.jb51.net, etc. are searched out.
If the use of MySQL with like words efficiency is very low, millions of or even tens of millions of data that is no way to use, so
In the last article to introduce the MySQL database performance optimization One, today continue to go on the article to introduce the database performance optimization related knowledge. The details are as follows:
Establish an appropriate index
Search for subdomains
For example, jb51.net searches for www.jb51.net, jb51.net, and host.jb51.net.
If mysql is used with like, the efficiency is very low. millions or even tens of millions of data cannot be used, so sphinx is used.
Many problems
Notes for using sphdomains in mysql to search for subdomains bitsCN.com
Search for subdomains
For example, bitsCN.com searches for www.bitsCN.com, bitsCN.com, and host.bitsCN.com.
If mysql is used with like, the efficiency is very low. millions or
For example, jb51.net searches www.jb51.net, jb51.net, SC .jb51.net, and so on.
For example, jb51.net searches www.jb51.net, jb51.net, SC .jb51.net, and so on.
Search for subdomains
For example, jb51.net searches for www.jb51.net, jb51.net, and
MySQL Database optimization techniques:The optimization of the database is a comprehensive technology, which mainly includes: 1. The design of the table is reasonable (in accordance with the three paradigms, 3NF) 2. Add an appropriate index
In order for you to better learn PHP, I mainly want to talk about the PHP Learning line this time so that you can better learn PHP. this time I mainly want to talk about the PHP Learning line, sort out the technical requirements of PHP programmers
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.